package leetcode.part1;

public class S9 {
    public boolean canJump(int[] nums) {
        if (nums.length==1) return true;
        int max=Integer.MIN_VALUE;
        for (int i = 0; i < nums.length; i++) {
            max=Math.max(max,i+nums[i]);
            if (i>=max)
                return false;
        }
        return true;
    }
    public static void main(String[] args) {
        int[] nums={0};
        S9 s=new S9();
        System.out.println(s.canJump(nums));
    }
}
